<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Enumeration and Flag Types: GObject Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GObject Reference Manual">
<link rel="up" href="rn01.html" title="API Reference">
<link rel="prev" href="gobject-The-Base-Object-Type.html" title="GObject">
<link rel="next" href="gobject-Boxed-Types.html" title="Boxed Types">
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gobject-Enumeration-and-Flag-Types.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gobject-The-Base-Object-Type.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gobject-Boxed-Types.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gobject-Enumeration-and-Flag-Types"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gobject-Enumeration-and-Flag-Types.top_of_page"></a>Enumeration and Flag Types</span></h2>
<p>Enumeration and Flag Types — Enumeration and flags types</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gobject-Enumeration-and-Flag-Types.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-ENUM-CLASS-TYPE:CAPS" title="G_ENUM_CLASS_TYPE()">G_ENUM_CLASS_TYPE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-ENUM-CLASS-TYPE-NAME:CAPS" title="G_ENUM_CLASS_TYPE_NAME()">G_ENUM_CLASS_TYPE_NAME</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-TYPE-IS-ENUM:CAPS" title="G_TYPE_IS_ENUM()">G_TYPE_IS_ENUM</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-ENUM-CLASS:CAPS" title="G_ENUM_CLASS()">G_ENUM_CLASS</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-IS-ENUM-CLASS:CAPS" title="G_IS_ENUM_CLASS()">G_IS_ENUM_CLASS</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-TYPE-IS-FLAGS:CAPS" title="G_TYPE_IS_FLAGS()">G_TYPE_IS_FLAGS</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-FLAGS-CLASS:CAPS" title="G_FLAGS_CLASS()">G_FLAGS_CLASS</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-IS-FLAGS-CLASS:CAPS" title="G_IS_FLAGS_CLASS()">G_IS_FLAGS_CLASS</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-FLAGS-CLASS-TYPE:CAPS" title="G_FLAGS_CLASS_TYPE()">G_FLAGS_CLASS_TYPE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#G-FLAGS-CLASS-TYPE-NAME:CAPS" title="G_FLAGS_CLASS_TYPE_NAME()">G_FLAGS_CLASS_TYPE_NAME</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="returnvalue">GEnumValue</span></a> *
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-get-value" title="g_enum_get_value ()">g_enum_get_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="returnvalue">GEnumValue</span></a> *
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-get-value-by-name" title="g_enum_get_value_by_name ()">g_enum_get_value_by_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="returnvalue">GEnumValue</span></a> *
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-get-value-by-nick" title="g_enum_get_value_by_nick ()">g_enum_get_value_by_nick</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="returnvalue">GFlagsValue</span></a> *
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-get-first-value" title="g_flags_get_first_value ()">g_flags_get_first_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="returnvalue">GFlagsValue</span></a> *
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-get-value-by-name" title="g_flags_get_value_by_name ()">g_flags_get_value_by_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="returnvalue">GFlagsValue</span></a> *
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-get-value-by-nick" title="g_flags_get_value_by_nick ()">g_flags_get_value_by_nick</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-register-static" title="g_enum_register_static ()">g_enum_register_static</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-register-static" title="g_flags_register_static ()">g_flags_register_static</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-complete-type-info" title="g_enum_complete_type_info ()">g_enum_complete_type_info</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-complete-type-info" title="g_flags_complete_type_info ()">g_flags_complete_type_info</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gobject-Enumeration-and-Flag-Types.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass">GEnumClass</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass">GFlagsClass</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue">GEnumValue</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue">GFlagsValue</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gobject-Enumeration-and-Flag-Types.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;glib-object.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gobject-Enumeration-and-Flag-Types.description"></a><h2>Description</h2>
<p>The GLib type system provides fundamental types for enumeration and
flags types. (Flags types are like enumerations, but allow their
values to be combined by bitwise or). A registered enumeration or
flags type associates a name and a nickname with each allowed
value, and the methods <a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-get-value-by-name" title="g_enum_get_value_by_name ()"><code class="function">g_enum_get_value_by_name()</code></a>,
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-get-value-by-nick" title="g_enum_get_value_by_nick ()"><code class="function">g_enum_get_value_by_nick()</code></a>, <a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-get-value-by-name" title="g_flags_get_value_by_name ()"><code class="function">g_flags_get_value_by_name()</code></a> and
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-get-value-by-nick" title="g_flags_get_value_by_nick ()"><code class="function">g_flags_get_value_by_nick()</code></a> can look up values by their name or
nickname.  When an enumeration or flags type is registered with the
GLib type system, it can be used as value type for object
properties, using <a class="link" href="gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-enum" title="g_param_spec_enum ()"><code class="function">g_param_spec_enum()</code></a> or <a class="link" href="gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-flags" title="g_param_spec_flags ()"><code class="function">g_param_spec_flags()</code></a>.</p>
<p>GObject ships with a utility called glib-mkenums,
that can construct suitable type registration functions from C enumeration
definitions.</p>
<p>Example of how to get a string representation of an enum value:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9</pre></td>
        <td class="listing_code"><pre class="programlisting">GEnumClass <span class="gtkdoc opt">*</span>enum_class<span class="gtkdoc opt">;</span>
GEnumValue <span class="gtkdoc opt">*</span>enum_value<span class="gtkdoc opt">;</span>

enum_class <span class="gtkdoc opt">=</span> <span class="function"><a href="gobject-Type-Information.html#g-type-class-ref">g_type_class_ref</a></span> <span class="gtkdoc opt">(</span>MAMAN_TYPE_MY_ENUM<span class="gtkdoc opt">);</span>
enum_value <span class="gtkdoc opt">=</span> <span class="function"><a href="gobject-Enumeration-and-Flag-Types.html#g-enum-get-value">g_enum_get_value</a></span> <span class="gtkdoc opt">(</span>enum_class<span class="gtkdoc opt">,</span> MAMAN_MY_ENUM_FOO<span class="gtkdoc opt">);</span>

<span class="function"><a href="../glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">&quot;Name: %s</span><span class="gtkdoc esc">\n</span><span class="string">&quot;</span><span class="gtkdoc opt">,</span> enum_value<span class="gtkdoc opt">-&gt;</span>value_name<span class="gtkdoc opt">);</span>

<span class="function"><a href="gobject-Type-Information.html#g-type-class-unref">g_type_class_unref</a></span> <span class="gtkdoc opt">(</span>enum_class<span class="gtkdoc opt">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
</div>
<div class="refsect1">
<a name="gobject-Enumeration-and-Flag-Types.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="G-ENUM-CLASS-TYPE:CAPS"></a><h3>G_ENUM_CLASS_TYPE()</h3>
<pre class="programlisting">#define G_ENUM_CLASS_TYPE(class)       (G_TYPE_FROM_CLASS (class))
</pre>
<p>Get the type identifier from a given <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> structure.</p>
<div class="refsect3">
<a name="G-ENUM-CLASS-TYPE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="G-ENUM-CLASS-TYPE.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-ENUM-CLASS-TYPE-NAME:CAPS"></a><h3>G_ENUM_CLASS_TYPE_NAME()</h3>
<pre class="programlisting">#define G_ENUM_CLASS_TYPE_NAME(class)  (g_type_name (G_ENUM_CLASS_TYPE (class)))
</pre>
<p>Get the static type name from a given <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> structure.</p>
<div class="refsect3">
<a name="G-ENUM-CLASS-TYPE-NAME.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="G-ENUM-CLASS-TYPE-NAME.returns"></a><h4>Returns</h4>
<p> the type name.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-TYPE-IS-ENUM:CAPS"></a><h3>G_TYPE_IS_ENUM()</h3>
<pre class="programlisting">#define G_TYPE_IS_ENUM(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM)
</pre>
<p>Checks whether <em class="parameter"><code>type</code></em>
 "is a" <a class="link" href="gobject-Type-Information.html#G-TYPE-ENUM:CAPS" title="G_TYPE_ENUM"><code class="literal">G_TYPE_ENUM</code></a>.</p>
<div class="refsect3">
<a name="G-TYPE-IS-ENUM.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> ID.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="G-TYPE-IS-ENUM.returns"></a><h4>Returns</h4>
<p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>type</code></em>
"is a" <a class="link" href="gobject-Type-Information.html#G-TYPE-ENUM:CAPS" title="G_TYPE_ENUM"><code class="literal">G_TYPE_ENUM</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-ENUM-CLASS:CAPS"></a><h3>G_ENUM_CLASS()</h3>
<pre class="programlisting">#define G_ENUM_CLASS(class)	       (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_ENUM, GEnumClass))
</pre>
<p>Casts a derived <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> structure into a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> structure.</p>
<div class="refsect3">
<a name="G-ENUM-CLASS.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a valid <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-IS-ENUM-CLASS:CAPS"></a><h3>G_IS_ENUM_CLASS()</h3>
<pre class="programlisting">#define G_IS_ENUM_CLASS(class)	       (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_ENUM))
</pre>
<p>Checks whether <em class="parameter"><code>class</code></em>
 "is a" valid <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> structure of type <a class="link" href="gobject-Type-Information.html#G-TYPE-ENUM:CAPS" title="G_TYPE_ENUM"><code class="literal">G_TYPE_ENUM</code></a>
or derived.</p>
<div class="refsect3">
<a name="G-IS-ENUM-CLASS.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-TYPE-IS-FLAGS:CAPS"></a><h3>G_TYPE_IS_FLAGS()</h3>
<pre class="programlisting">#define G_TYPE_IS_FLAGS(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_FLAGS)
</pre>
<p>Checks whether <em class="parameter"><code>type</code></em>
 "is a" <a class="link" href="gobject-Type-Information.html#G-TYPE-FLAGS:CAPS" title="G_TYPE_FLAGS"><code class="literal">G_TYPE_FLAGS</code></a>.</p>
<div class="refsect3">
<a name="G-TYPE-IS-FLAGS.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> ID.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="G-TYPE-IS-FLAGS.returns"></a><h4>Returns</h4>
<p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>type</code></em>
"is a" <a class="link" href="gobject-Type-Information.html#G-TYPE-FLAGS:CAPS" title="G_TYPE_FLAGS"><code class="literal">G_TYPE_FLAGS</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-FLAGS-CLASS:CAPS"></a><h3>G_FLAGS_CLASS()</h3>
<pre class="programlisting">#define G_FLAGS_CLASS(class)	       (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_FLAGS, GFlagsClass))
</pre>
<p>Casts a derived <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> structure into a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> structure.</p>
<div class="refsect3">
<a name="G-FLAGS-CLASS.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a valid <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-IS-FLAGS-CLASS:CAPS"></a><h3>G_IS_FLAGS_CLASS()</h3>
<pre class="programlisting">#define G_IS_FLAGS_CLASS(class)        (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_FLAGS))
</pre>
<p>Checks whether <em class="parameter"><code>class</code></em>
 "is a" valid <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> structure of type <a class="link" href="gobject-Type-Information.html#G-TYPE-FLAGS:CAPS" title="G_TYPE_FLAGS"><code class="literal">G_TYPE_FLAGS</code></a>
or derived.</p>
<div class="refsect3">
<a name="G-IS-FLAGS-CLASS.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-FLAGS-CLASS-TYPE:CAPS"></a><h3>G_FLAGS_CLASS_TYPE()</h3>
<pre class="programlisting">#define G_FLAGS_CLASS_TYPE(class)      (G_TYPE_FROM_CLASS (class))
</pre>
<p>Get the type identifier from a given <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> structure.</p>
<div class="refsect3">
<a name="G-FLAGS-CLASS-TYPE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="G-FLAGS-CLASS-TYPE.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="G-FLAGS-CLASS-TYPE-NAME:CAPS"></a><h3>G_FLAGS_CLASS_TYPE_NAME()</h3>
<pre class="programlisting">#define G_FLAGS_CLASS_TYPE_NAME(class) (g_type_name (G_FLAGS_CLASS_TYPE (class)))
</pre>
<p>Get the static type name from a given <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> structure.</p>
<div class="refsect3">
<a name="G-FLAGS-CLASS-TYPE-NAME.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="G-FLAGS-CLASS-TYPE-NAME.returns"></a><h4>Returns</h4>
<p> the type name.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-enum-get-value"></a><h3>g_enum_get_value ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="returnvalue">GEnumValue</span></a> *
g_enum_get_value (<em class="parameter"><code><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> *enum_class</code></em>,
                  <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> value</code></em>);</pre>
<p>Returns the <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> for a value.</p>
<div class="refsect3">
<a name="g-enum-get-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>enum_class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the value to look up</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-enum-get-value.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> for <em class="parameter"><code>value</code></em>
, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
if <em class="parameter"><code>value</code></em>
is not a member of the enumeration. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-enum-get-value-by-name"></a><h3>g_enum_get_value_by_name ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="returnvalue">GEnumValue</span></a> *
g_enum_get_value_by_name (<em class="parameter"><code><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> *enum_class</code></em>,
                          <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>Looks up a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> by name.</p>
<div class="refsect3">
<a name="g-enum-get-value-by-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>enum_class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name to look up</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-enum-get-value-by-name.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> with name <em class="parameter"><code>name</code></em>
,
or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the enumeration doesn't have a member
with that name. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-enum-get-value-by-nick"></a><h3>g_enum_get_value_by_nick ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="returnvalue">GEnumValue</span></a> *
g_enum_get_value_by_nick (<em class="parameter"><code><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a> *enum_class</code></em>,
                          <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *nick</code></em>);</pre>
<p>Looks up a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> by nickname.</p>
<div class="refsect3">
<a name="g-enum-get-value-by-nick.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>enum_class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumClass" title="struct GEnumClass"><span class="type">GEnumClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>nick</p></td>
<td class="parameter_description"><p>the nickname to look up</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-enum-get-value-by-nick.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> with nickname <em class="parameter"><code>nick</code></em>
,
or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the enumeration doesn't have a member
with that nickname. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-flags-get-first-value"></a><h3>g_flags_get_first_value ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="returnvalue">GFlagsValue</span></a> *
g_flags_get_first_value (<em class="parameter"><code><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> *flags_class</code></em>,
                         <em class="parameter"><code><a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a> value</code></em>);</pre>
<p>Returns the first <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> which is set in <em class="parameter"><code>value</code></em>
.</p>
<div class="refsect3">
<a name="g-flags-get-first-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>flags_class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the value</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-flags-get-first-value.returns"></a><h4>Returns</h4>
<p> the first <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> which is set in
<em class="parameter"><code>value</code></em>
, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none is set. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-flags-get-value-by-name"></a><h3>g_flags_get_value_by_name ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="returnvalue">GFlagsValue</span></a> *
g_flags_get_value_by_name (<em class="parameter"><code><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> *flags_class</code></em>,
                           <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>Looks up a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> by name.</p>
<div class="refsect3">
<a name="g-flags-get-value-by-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>flags_class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name to look up</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-flags-get-value-by-name.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> with name <em class="parameter"><code>name</code></em>
,
or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no flag with that name. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-flags-get-value-by-nick"></a><h3>g_flags_get_value_by_nick ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="returnvalue">GFlagsValue</span></a> *
g_flags_get_value_by_nick (<em class="parameter"><code><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a> *flags_class</code></em>,
                           <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *nick</code></em>);</pre>
<p>Looks up a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> by nickname.</p>
<div class="refsect3">
<a name="g-flags-get-value-by-nick.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>flags_class</p></td>
<td class="parameter_description"><p>a <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsClass" title="struct GFlagsClass"><span class="type">GFlagsClass</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>nick</p></td>
<td class="parameter_description"><p>the nickname to look up</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-flags-get-value-by-nick.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> with nickname <em class="parameter"><code>nick</code></em>
,
or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no flag with that nickname. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-enum-register-static"></a><h3>g_enum_register_static ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>
g_enum_register_static (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                        <em class="parameter"><code>const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> *const_static_values</code></em>);</pre>
<p>Registers a new static enumeration type with the name <em class="parameter"><code>name</code></em>
.</p>
<p>It is normally more convenient to let glib-mkenums,
generate a <code class="function">my_enum_get_type()</code> function from a usual C enumeration
definition  than to write one yourself using <a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-register-static" title="g_enum_register_static ()"><code class="function">g_enum_register_static()</code></a>.</p>
<div class="refsect3">
<a name="g-enum-register-static.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>A nul-terminated string used as the name of the new type.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>const_static_values</p></td>
<td class="parameter_description"><p>An array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> structs for the possible
enumeration values. The array is terminated by a struct with all
members being 0. GObject keeps a reference to the data, so it cannot
be stack-allocated.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-enum-register-static.returns"></a><h4>Returns</h4>
<p> The new type identifier.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-flags-register-static"></a><h3>g_flags_register_static ()</h3>
<pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>
g_flags_register_static (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                         <em class="parameter"><code>const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> *const_static_values</code></em>);</pre>
<p>Registers a new static flags type with the name <em class="parameter"><code>name</code></em>
.</p>
<p>It is normally more convenient to let glib-mkenums
generate a <code class="function">my_flags_get_type()</code> function from a usual C enumeration
definition than to write one yourself using <a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-flags-register-static" title="g_flags_register_static ()"><code class="function">g_flags_register_static()</code></a>.</p>
<div class="refsect3">
<a name="g-flags-register-static.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>A nul-terminated string used as the name of the new type.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>const_static_values</p></td>
<td class="parameter_description"><p>An array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> structs for the possible
flags values. The array is terminated by a struct with all members being 0.
GObject keeps a reference to the data, so it cannot be stack-allocated.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-flags-register-static.returns"></a><h4>Returns</h4>
<p> The new type identifier.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-enum-complete-type-info"></a><h3>g_enum_complete_type_info ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_enum_complete_type_info (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_enum_type</code></em>,
                           <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>,
                           <em class="parameter"><code>const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> *const_values</code></em>);</pre>
<p>This function is meant to be called from the <code class="literal">complete_type_info</code>
function of a <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> implementation, as in the following
example:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">static void</span>
<span class="function">my_enum_complete_type_info</span> <span class="gtkdoc opt">(</span>GTypePlugin     <span class="gtkdoc opt">*</span>plugin<span class="gtkdoc opt">,</span>
                            GType            g_type<span class="gtkdoc opt">,</span>
                            GTypeInfo       <span class="gtkdoc opt">*</span>info<span class="gtkdoc opt">,</span>
                            GTypeValueTable <span class="gtkdoc opt">*</span>value_table<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
  <span class="gtkdoc kwb">static const</span> GEnumValue values<span class="gtkdoc opt">[] = {</span>
    <span class="gtkdoc opt">{</span> MY_ENUM_FOO<span class="gtkdoc opt">,</span> <span class="string">&quot;MY_ENUM_FOO&quot;</span><span class="gtkdoc opt">,</span> <span class="string">&quot;foo&quot;</span> <span class="gtkdoc opt">},</span>
    <span class="gtkdoc opt">{</span> MY_ENUM_BAR<span class="gtkdoc opt">,</span> <span class="string">&quot;MY_ENUM_BAR&quot;</span><span class="gtkdoc opt">,</span> <span class="string">&quot;bar&quot;</span> <span class="gtkdoc opt">},</span>
    <span class="gtkdoc opt">{</span> <span class="number">0</span><span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">,</span> NULL <span class="gtkdoc opt">}</span>
  <span class="gtkdoc opt">};</span>

  <span class="function"><a href="gobject-Enumeration-and-Flag-Types.html#g-enum-complete-type-info">g_enum_complete_type_info</a></span> <span class="gtkdoc opt">(</span>type<span class="gtkdoc opt">,</span> info<span class="gtkdoc opt">,</span> values<span class="gtkdoc opt">);</span>
<span class="gtkdoc opt">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<div class="refsect3">
<a name="g-enum-complete-type-info.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>g_enum_type</p></td>
<td class="parameter_description"><p>the type identifier of the type being completed</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p> the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> struct to be filled in. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out callee-allocates</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>const_values</p></td>
<td class="parameter_description"><p>An array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> structs for the possible
enumeration values. The array is terminated by a struct with all
members being 0.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-flags-complete-type-info"></a><h3>g_flags_complete_type_info ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_flags_complete_type_info (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_flags_type</code></em>,
                            <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>,
                            <em class="parameter"><code>const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> *const_values</code></em>);</pre>
<p>This function is meant to be called from the <code class="function">complete_type_info()</code>
function of a <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> implementation, see the example for
<a class="link" href="gobject-Enumeration-and-Flag-Types.html#g-enum-complete-type-info" title="g_enum_complete_type_info ()"><code class="function">g_enum_complete_type_info()</code></a> above.</p>
<div class="refsect3">
<a name="g-flags-complete-type-info.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>g_flags_type</p></td>
<td class="parameter_description"><p>the type identifier of the type being completed</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p> the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> struct to be filled in. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out callee-allocates</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>const_values</p></td>
<td class="parameter_description"><p>An array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> structs for the possible
enumeration values. The array is terminated by a struct with all
members being 0.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="gobject-Enumeration-and-Flag-Types.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GEnumClass"></a><h3>struct GEnumClass</h3>
<pre class="programlisting">struct GEnumClass {
  GTypeClass  g_type_class;

  gint	      minimum;
  gint	      maximum;
  guint	      n_values;
  GEnumValue *values;
};
</pre>
<p>The class of an enumeration type holds information about its 
possible values.</p>
<div class="refsect3">
<a name="GEnumClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> <em class="structfield"><code><a name="GEnumClass.g-type-class"></a>g_type_class</code></em>;</p></td>
<td class="struct_member_description"><p>the parent class</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GEnumClass.minimum"></a>minimum</code></em>;</p></td>
<td class="struct_member_description"><p>the smallest possible value.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GEnumClass.maximum"></a>maximum</code></em>;</p></td>
<td class="struct_member_description"><p>the largest possible value.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GEnumClass.n-values"></a>n_values</code></em>;</p></td>
<td class="struct_member_description"><p>the number of possible values.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> *<em class="structfield"><code><a name="GEnumClass.values"></a>values</code></em>;</p></td>
<td class="struct_member_description"><p>an array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="struct GEnumValue"><span class="type">GEnumValue</span></a> structs describing the
individual values.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GFlagsClass"></a><h3>struct GFlagsClass</h3>
<pre class="programlisting">struct GFlagsClass {
  GTypeClass   g_type_class;
  
  guint	       mask;
  guint	       n_values;
  GFlagsValue *values;
};
</pre>
<p>The class of a flags type holds information about its 
possible values.</p>
<div class="refsect3">
<a name="GFlagsClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> <em class="structfield"><code><a name="GFlagsClass.g-type-class"></a>g_type_class</code></em>;</p></td>
<td class="struct_member_description"><p>the parent class</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GFlagsClass.mask"></a>mask</code></em>;</p></td>
<td class="struct_member_description"><p>a mask covering all possible values.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GFlagsClass.n-values"></a>n_values</code></em>;</p></td>
<td class="struct_member_description"><p>the number of possible values.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> *<em class="structfield"><code><a name="GFlagsClass.values"></a>values</code></em>;</p></td>
<td class="struct_member_description"><p>an array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="struct GFlagsValue"><span class="type">GFlagsValue</span></a> structs describing the
individual values.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GEnumValue"></a><h3>struct GEnumValue</h3>
<pre class="programlisting">struct GEnumValue {
  gint	 value;
  const gchar *value_name;
  const gchar *value_nick;
};
</pre>
<p>A structure which contains a single enum value, its name, and its
nickname.</p>
<div class="refsect3">
<a name="GEnumValue.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GEnumValue.value"></a>value</code></em>;</p></td>
<td class="struct_member_description"><p>the enum value</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GEnumValue.value-name"></a>value_name</code></em>;</p></td>
<td class="struct_member_description"><p>the name of the value</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GEnumValue.value-nick"></a>value_nick</code></em>;</p></td>
<td class="struct_member_description"><p>the nickname of the value</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GFlagsValue"></a><h3>struct GFlagsValue</h3>
<pre class="programlisting">struct GFlagsValue {
  guint	 value;
  const gchar *value_name;
  const gchar *value_nick;
};
</pre>
<p>A structure which contains a single flags value, its name, and its
nickname.</p>
<div class="refsect3">
<a name="GFlagsValue.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GFlagsValue.value"></a>value</code></em>;</p></td>
<td class="struct_member_description"><p>the flags value</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GFlagsValue.value-name"></a>value_name</code></em>;</p></td>
<td class="struct_member_description"><p>the name of the value</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GFlagsValue.value-nick"></a>value_nick</code></em>;</p></td>
<td class="struct_member_description"><p>the nickname of the value</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="gobject-Enumeration-and-Flag-Types.see-also"></a><h2>See Also</h2>
<p><a class="link" href="gobject-Standard-Parameter-and-Value-Types.html#GParamSpecEnum" title="struct GParamSpecEnum"><span class="type">GParamSpecEnum</span></a>, <a class="link" href="gobject-Standard-Parameter-and-Value-Types.html#GParamSpecFlags" title="struct GParamSpecFlags"><span class="type">GParamSpecFlags</span></a>, <a class="link" href="gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-enum" title="g_param_spec_enum ()"><code class="function">g_param_spec_enum()</code></a>,
<a class="link" href="gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-flags" title="g_param_spec_flags ()"><code class="function">g_param_spec_flags()</code></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25.1</div>
</body>
</html>